<!--
 * @Author: wangshiyang
 * @Date: 2023-06-15 17:02:28
 * @LastEditors: wangshiyang
 * @LastEditTime: 2023-06-16 09:00:12
 * @Description: 请填写简介
-->
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link href="https://api.mapbox.com/mapbox-gl-js/v2.9.1/mapbox-gl.css" rel="stylesheet">
    <script src="https://api.mapbox.com/mapbox-gl-js/v2.9.1/mapbox-gl.js"></script>
    <script src='https://unpkg.com/@antv/l7'></script>
    <style>
        html,
        body {
            overflow: hidden;
            margin: 0;
        }

        #map {
            position: absolute;
            top: 0;
            bottom: 0;
            width: 100%;
        }
    </style>
</head>

<body>
    <div id="map"></div>
    <script>
        mapboxgl.accessToken = 'pk.eyJ1IjoiY2hlbmdiZW5jaGFvIiwiYSI6ImNsODU3aGRiODA0Y2UzcHBzZmFlcmdqZ2sifQ.8k59W_pB_Riwe6o-MneRlA'
        const scene = new L7.Scene({
            id: 'map',
            map: new L7.Mapbox({
                style: 'mapbox://styles/mapbox/streets-v11',
                center: [114, 30],
                zoom: 12,
                projection: 'globe'
            })
        });
        const map = scene.map;



        map.on('load', () => {
            map.setFog({});
            const marker = new mapboxgl.Marker({
                draggable: true
            }).setLngLat([114.30, 30.50]).addTo(map);
            marker.on("dragend", onDragEnd)
            function onDragEnd() {
                var lngLat = marker.getLngLat();
                console.log(lngLat)
            }
        });
    </script>
</body>

</html>